define(function(require, exports){
	exports.onMain = function(boot,data,app){
		if (!app.routerValid('condition.list')) {
			return;
		}

		var title = LANG('条件列表');
		var con = app.getContainer({
			scenes: 'main',
			full: false,
			sitelist: false,
			setup_btn: false,
			type: 'sidebar',
			title:title
		});

		app.core.get('SYS_PLATFORM').setPlatform(title);
		con.createBusiness(data.name, 'condition/action/list.base', {
		}, function(mod, created){
			if(created){
				mod.reload();
			}
		});
	};
	exports.onEdit = function(boot,data,app){
		var param = data && data.param;
		var auth = param ? 'condition.update' : 'condition.add';
		if(!app.routerValid(auth))
		{
			return;
		}

		var title = param ? LANG('编辑条件') : LANG('添加条件');
		var con = app.getContainer({
			scenes: 'main',
			full: false,
			sitelist: false,
			setup_btn: false,
			title:	title,
			type: 'scroll'
		});

		app.core.get('SYS_PLATFORM').setPlatform(title);

		con.createBusiness(data.name, 'condition/action/edit.base', {
		}, function(mod){
			mod.reset();
			if(param){
				mod.load(+param);
			}
		});

	};
});